# f = open("ads.txt", "w")
# f.write("bbb")
# f.close()

# f = open("ads.txt", 'a')
# f.write("369258")
# f.close()

# f = open("ads.txt")
# f.close()

# f = open("ads.txt")
# print(f.read())
# f.close()

# f = open("ads.txt")
# print(f.readline())
# print(f.readline())
# print(f.readline())
# f.close()

# f = open("ads.txt", "r+")
# print(f.read())
# f.seek(2, 0)
# print(f.read())
# f.close()

# f = open("ads.txt", "a+")
# print(f.read())
# f.seek(0)
# print(f.read())
# f.close()

old_name = input("请输入要备份的文件名:")
index = old_name.rfind('.')
print(index)
new_name = old_name[:index] + '[备份]' + old_name[index:]
print(new_name)

old_f = open(old_name, "rb")
new_f = open(new_name, "wb")

while True:
    con = old_f.read(1024)
    if len(con):
        break
    new_f.write(con)

old_f.close()
new_f.close()